package com.thread;

public class suspendCls implements Runnable{

	@Override
	public void run() {
		susp();
		resumes();
	}
	
	void susp(){
		System.out.println("--------suspend start--------");
		Thread.currentThread().suspend();
		System.out.println("---------suspend over-------------");		
	}

	void resumes(){
		System.out.println("------------resume start-----------------");
		Thread.currentThread().resume();
		System.out.print("-----------resume over------------");
	}
	
	public static void main(String[]args){
		suspendCls sc=new suspendCls();
		System.out.println("Thread start");
		new Thread(sc).start();
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("Thread resumes");
		new  Thread(sc).start();
		
		
	}
}
